<template>
<div>
  <h3 class="title">
    <Icon style="color: #235CA7" type="ios-albums-outline" />
    <span class="statistics_2">商户</span>：{{shanghuNum}}</h3>
  <h3 class="title">
    <Icon style="color: #235CA7" type="ios-albums-outline" />
    <span class="statistics_3">养老机构</span>：{{yanglaoNum}}</h3>
<!--  <h3 class="title">-->
<!--    <Icon style="color: #235CA7" type="ios-albums-outline" />-->
<!--    <span class="statistics_3">家庭养老床位</span>：{{jtylcw}}</h3>-->
  <h3 class="title">
    <Icon style="color: #235CA7" type="ios-albums-outline" />
    <span class="statistics_3">高龄补贴</span>：{{glbt}}</h3>
  <h3 class="title">
    <Icon style="color: #235CA7" type="ios-albums-outline" />
    <span class="statistics_3">低保户</span>：{{dbh}}</h3>
<!--  <h3 class="title">-->
<!--    <Icon style="color: #235CA7" type="ios-albums-outline" />-->
<!--    <span class="statistics_3">低收入家庭</span>：{{dsrjt}}</h3>-->
<!--  <h3 class="title">-->
<!--    <Icon style="color: #235CA7" type="ios-albums-outline" />-->
<!--    <span class="statistics_3">政府购买服务对象（普惠）</span>：{{gmfwdxph}}</h3>-->
<!--  <h3 class="title">-->
<!--    <Icon style="color: #235CA7" type="ios-albums-outline" />-->
<!--    <span class="statistics_3">政府购买服务对象（关爱）</span>：{{gmfwdxga}}</h3>-->
</div>
</template>

<script>
import { getLabelPeopleNum, getPlaceNum } from '../../../../api/eventlist'

export default {
  name: 'grid-other-statistics',
  props: {
    pickID: {
      type: String
    },
    pickGrade: {
      type: String
    }
  },
  data () {
    return {
      shanghuNum: 0,
      yanglaoNum: 0,
      jtylcw: 0,
      glbt: 0,
      dbh: 0,
      dsrjt: 0,
      gmfwdxph: 0,
      gmfwdxga: 0
    }
  },
  methods: {
    init (e1, e2) {
      // 商户
      this.getPlaceNum(e1, e2, 'P0003')
      // 养老机构
      this.getPlaceNum(e1, e2, 'P0000-10')
      // 养老床位
      // this.getLabelPeopleNum(e1, e2, 'L0093-1645151779318')
      // 高龄补贴
      this.getLabelPeopleNum(e1, e2, 'L0093-1645151926504')
      // 政府购买服务对象（普惠）
      // this.getLabelPeopleNum(e1, e2, 'L0093-1645151947556')
      // 政府购买服务对象（关爱）
      // this.getLabelPeopleNum(e1, e2, 'L0093-1645151974601')
      // 低保户
      this.getLabelPeopleNum(e1, e2, 'L002-1619157785418')
      // 低收入家庭
      // this.getLabelPeopleNum(e1, e2, 'L002-1619157789774')
    },
    getPlaceNum (e1, e2, e3) {
      let data = {
        merchant_type: e3,
        community_id: e2
      }
      getPlaceNum(data).then(ret => {
        if (ret.data.errcode === 0) {
          if (e3 === 'P0003') {
            this.shanghuNum = ret.data.data.num
          }
          if (e3 === 'P0000-10') {
            this.yanglaoNum = ret.data.data.num
          }
        } else {
          this.$Notice.error({ title: '查询失败！', desc: ret.data.msg })
        }
      })
    },
    getLabelPeopleNum (e1, e2, e3) {
      let data = {
        second_level_id: e3,
        community_id: e2
      }
      getLabelPeopleNum(data).then(ret => {
        if (ret.data.errcode === 0) {
          if (e3 === 'L0093-1645151779318') {
            this.jtylcw = ret.data.data.num
          }
          if (e3 === 'L0093-1645151926504') {
            this.glbt = ret.data.data.num
          }
          if (e3 === 'L0093-1645151947556') {
            this.gmfwdxph = ret.data.data.num
          }
          if (e3 === 'L0093-1645151974601') {
            this.gmfwdxga = ret.data.data.num
          }
          if (e3 === 'L002-1619157785418') {
            this.dbh = ret.data.data.num
          }
          if (e3 === 'L002-1619157789774') {
            this.dsrjt = ret.data.data.num
          }
        } else {
          this.$Notice.error({ title: '查询失败！', desc: ret.data.msg })
        }
      })
    }
  },
  watch: {
    pickID: function (val) {
      if (this.pickGrade === '5') {
        this.init(this.pickGrade, this.pickID)
      }
    }
  }
}
</script>

<style scoped>
.statistics_2{
  letter-spacing: 20px;
  margin-left: 10px;
  font-size: 16px
}
.statistics_3{
  letter-spacing: 8px;
  margin-left: 10px;
  font-size: 16px
}
.statistics_4{
  letter-spacing: 2px;
  margin-left: 10px;
  font-size: 16px
}

</style>
